Skip to content

[Segment Replication] Refactor RemoteStoreReplicationSource (#8767)#9076

Merged
dreamer-89 merged 3 commits into
opensearch-project:2.xfrom
dreamer-89:backport/backport-8767-to-2.x
Aug 3, 2023
Merged

[Segment Replication] Refactor RemoteStoreReplicationSource (#8767)#9076
dreamer-89 merged 3 commits into
opensearch-project:2.xfrom
dreamer-89:backport/backport-8767-to-2.x

Conversation

@dreamer-89
Copy link
Copy Markdown
Member

@dreamer-89 dreamer-89 commented Aug 2, 2023

Manual backport of #8767 to 2.x

Note: This needs to be merged in after as this PR contain changes on top of below two PRs. Keeping in draft until below are backported.

  1. [Remote Store] Add Segment download stats to remotestore stats API #8718
  2. Restrict user overrides for remote store related index settings #8812

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Aug 2, 2023

Gradle Check (Jenkins) Run Completed with:

…ch-project#8767)

* [Segment Replication] Refactor remote replication source

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Unit test updates

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Self review

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Self review

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Segregate shard level tests for node to node and remote store segment replication

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Fix failing unit tests

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Fix failing UT

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Fix failing UT

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Address review comments

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Fix more unit tests

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Improve RemoteStoreReplicationSourceTests, remove unnecessary mocks and use actual failures for failure/exception use cases

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Spotless check fix

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Address review comments

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Ignore files already in store while computing segment file diff with primary

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Spotless fix

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Fix failing UT

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Spotless fix

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Move read/writes from IndexInput/Output to RemoteSegmentMetadata

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Address review commnt

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Update recovery flow to perform commits during recovery

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Remove un-necessary char

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Address review comments

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Update comment nit-pick

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Remove deletion logic causing read issues due to deleted segments_N

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Spotless fix

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Fix unit tests

Signed-off-by: Suraj Singh <surajrider@gmail.com>

---------

Signed-off-by: Suraj Singh <surajrider@gmail.com>
Signed-off-by: Suraj Singh <surajrider@gmail.com>
@dreamer-89 dreamer-89 force-pushed the backport/backport-8767-to-2.x branch from 2e37b6b to fbed447 Compare August 3, 2023 17:10
@dreamer-89 dreamer-89 marked this pull request as ready for review August 3, 2023 17:11
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Aug 3, 2023

Gradle Check (Jenkins) Run Completed with:

Signed-off-by: Suraj Singh <surajrider@gmail.com>
@opensearch-trigger-bot
Copy link
Copy Markdown
Contributor

Compatibility status:



> Task :checkCompatibility
Incompatible components: [https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/ml-commons.git]
Components skipped due to git failures: [https://github.com/opensearch-project/opensearch-oci-object-storage.git]
Compatible components: [https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/performance-analyzer-rca.git]

BUILD SUCCESSFUL in 31m 26s

@opensearch-trigger-bot
Copy link
Copy Markdown
Contributor

Compatibility status:



> Task :checkCompatibility
Incompatible components: [https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/ml-commons.git]
Components skipped due to git failures: [https://github.com/opensearch-project/opensearch-oci-object-storage.git]
Compatible components: [https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/reporting.git]

BUILD SUCCESSFUL in 29m 57s

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Aug 3, 2023

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.client.PitIT.testDeleteAllAndListAllPits

@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 3, 2023

Codecov Report

Merging #9076 (0e9c7d7) into 2.x (6ab46bd) will increase coverage by 0.13%.
The diff coverage is 97.53%.

@@             Coverage Diff              @@
##                2.x    #9076      +/-   ##
============================================
+ Coverage     70.72%   70.86%   +0.13%     
- Complexity    57372    57497     +125     
============================================
  Files          4754     4754              
  Lines        271625   271647      +22     
  Branches      40066    40067       +1     
============================================
+ Hits         192102   192494     +392     
+ Misses        62972    62655     -317     
+ Partials      16551    16498      -53     
Files Changed Coverage Δ
...ch/indices/recovery/PeerRecoveryTargetService.java 51.96% <0.00%> (-1.97%) ⬇️
...ices/replication/RemoteStoreReplicationSource.java 90.74% <96.42%> (-3.55%) ⬇️
...in/java/org/opensearch/index/shard/IndexShard.java 69.11% <100.00%> (-0.59%) ⬇️
...search/index/shard/RemoteStoreRefreshListener.java 84.61% <100.00%> (-0.09%) ⬇️
...java/org/opensearch/index/shard/StoreRecovery.java 57.25% <100.00%> (ø)
...earch/index/store/RemoteSegmentStoreDirectory.java 87.70% <100.00%> (ø)
...rc/main/java/org/opensearch/index/store/Store.java 80.65% <100.00%> (+0.40%) ⬆️
...x/store/remote/metadata/RemoteSegmentMetadata.java 100.00% <100.00%> (ø)
...h/indices/replication/GetSegmentFilesResponse.java 44.44% <100.00%> (+6.94%) ⬆️
.../indices/replication/SegmentReplicationTarget.java 89.32% <100.00%> (+5.48%) ⬆️

... and 473 files with indirect coverage changes

@dreamer-89 dreamer-89 merged commit 94338e5 into opensearch-project:2.x Aug 3, 2023
@dreamer-89 dreamer-89 deleted the backport/backport-8767-to-2.x branch August 3, 2023 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants